import request from '@/utils/request'

// 查询智能柜分屏广告列表
export function listAdvertisement(query) {
  return request({
    url: '/launch/advertisement/list',
    method: 'get',
    params: query
  })
}

// 查询智能柜分屏广告详细
export function getAdvertisement(id) {
  return request({
    url: '/launch/advertisement/' + id,
    method: 'get'
  })
}

// 新增智能柜分屏广告
export function addAdvertisement(data) {
  return request({
    url: '/launch/advertisement',
    method: 'post',
    data: data
  })
}

// 修改智能柜分屏广告
export function updateAdvertisement(data) {
  return request({
    url: '/launch/advertisement',
    method: 'put',
    data: data
  })
}
//推送
export function upPushStatus(id) {
  return request({
    url: '/launch/advertisement/upPushStatus/'+id,
    method: 'put'
  })
}
// 下架
export function downPushStatus(id) {
  return request({
    url: '/launch/advertisement/downPushStatus/'+id,
    method: 'put'
  })
}
//推送日期
export function pushTime(data) {
  return request({
    url: '/launch/advertisement/pushTime/',
    method: 'put',
    data:data
  })
}

// 删除智能柜分屏广告
export function delAdvertisement(id) {
  return request({
    url: '/launch/advertisement/' + id,
    method: 'delete'
  })
}
